HAL CRC migration: List of applicable concepts ¶
This section provides information about the HAL CRC applicable architecture concepts.
Concepts for CRC ¶
|
Concept |
Description |
|---|---|
|
The initialization has been split into two levels of functions:
|
|
|
Removal and conversion of init structure to configuration structure |
The init structure has been removed and moved into
|
|
The handle structure has been renamed to
|
|
|
The structure
|
|
|
|
|
|
New APIs are available to get and set CRC features. |
|
|
Two functions to set and get user data are available:
|
|
|
All hardware macros have been removed from the HAL CRC driver, and equivalent services are ensured through the LL APIs. |
|
|
The CRC now is managed by three states:
|
|
|
The HAL CRC functions were updated to return:
|
|
|
The HAL error handling mechanisms have been redesigned to improve the detection, reporting, and handling of errors. This provides more detailed and consistent error information. |
|
|
All TypeDef parts of the HAL CRC driver have been removed and replaced by
|
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
The parameters and state are checked using
|
|
|
Merge HAL extension files with common ones and remove the EX prefix from APIs. |
Only one HAL CRC header file remains and all macros, define statements, and functions from
|
|
Provide RTOS-compatible acquire/release bus services for communication peripheral drivers. |
Lock management mechanisms have been removed from the HAL CRC layer. |
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including CRC instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
Other HAL CRC changes ¶
|
Concept |
Consideration |
|---|---|
|
Rework of the configuration structure: Renaming parameters |
|
|
Introduce the
|
Provide
|
|
Rework of calculate and accumulate functions. |
New CRC optimized calculation method for performance and footprint: - The user should only provide a pointer to void buffer ( no more input data format is used) and the buffer size should be the number of bytes - The user does not need to preprocess his data buffer depending on the data format. - The main idea of this method is to read from the input buffer with a step of 4 bytes using the 32bits pointer alignment concept. This method includes 3 steps: Step1:Read the first non-aligned 32 bits buffer address (if they exist) from the input buffer and feed its data into DR register. This operation stops when the incremented address becomes 32 bits aligned Step2: Read aligned 32 bits buffer address with a 32bits step and feed its data into DR register. Step3: Read the last bytes if buffer length is not multiple of 4. |